<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>小球</title>
    <style>
        @import url("https://fonts.googleapis.com/css?family=Montserrat&display=swap");

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background: #0081cb33;
            font-family: "Montserrat", sans-serif;
        }

        .ball {
            position: absolute;
            bottom: 25px;
            right: -40px;
            width: 100px;
            height: 100px;
            background: #ff0022;
            border-radius: 50%;
            animation: ball-move 4s ease-in-out 2s infinite alternate;
        }

        .ball::after {
            position: absolute;
            content: '';
            top: 50px;
            right: 10px;
            width: 10px;
            height: 10px;
            background: #FFF;
            border-radius: 50%;
        }

        .bar {
            width: 500px;
            height: 25px;
            background: black;
            border-radius: 30px;
            transform: rotate(-15deg);
            filter: drop-shadow(20px 10px 4px gray);
            animation: up-down 4s ease-in-out 2s infinite alternate;
        }

        @keyframes up-down {
            from {
                transform: rotate(-15deg);
            }

            to {
                transform: rotate(15deg);
            }
        }

        @keyframes ball-move {
            from {
                right: -40px;
                transform: rotate(360deg);
            }

            to {
                right: 440px;
                transform: rotate(0deg);
            }
        }

        .credits {
            position: fixed;
            bottom: 8px;
            right: 2px;
            width: auto;
            height: auto;
            z-index: 99;
            background: red;
            padding: 10px;
            border-radius: 10px;
            background: #333;
            color: #fff;
            cursor: pointer;
            font-size: 10px;
            display: block;
        }

        .credits a {
            background: #333;
            color: #fff;
            cursor: pointer;
        }
    </style>
</head>

<body>
    <div class="bar">
        <div class="ball"></div>
    </div>

    <div class="credits">
        Liked my pen? <br />
        <a href="https://codepen.io/aniketkudale" target="_blank">Follow me</a> for
        more
    </div>
</body>

</html>